//
//  BaseViewController.swift
//  SinaWeibo
//
//  Created by 许良 on 16/6/1.
//  Copyright © 2016年 fading. All rights reserved.
//

import UIKit

class BaseViewController: UITableViewController, VisitorViewDelegate {
    
    var userLogin = true
    
    var visitorView : VisitorView?
    override func loadView() {
        
        userLogin ? super.loadView() : setupVistorView()
    }
    
    // MARK: - 创建未登录界面
    private func setupVistorView () {
        let customView = VisitorView()
        customView.deleagte = self
        view = customView
        visitorView = customView
        
        navigationController?.navigationBar.tintColor = UIColor.orangeColor()
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: .Plain, target: self, action: #selector(BaseViewController.registerBtnWillClick))
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: .Plain, target: self, action: #selector(BaseViewController.loginBtnWillClick))

    }
    
    
    func loginBtnWillClick () {
        
    }
    
    func registerBtnWillClick () {
        
    }
    
    
}
